﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Navigation;
using System.Windows.Shapes;

using System.Globalization;
using System.Windows.Media.Animation;

namespace App10._10
{
    /// <summary>
    /// Interaction logic for Window1.xaml
    /// </summary>
    public partial class Window1 : Window
    {
        public Window1()
        {
            InitializeComponent();
        }

        public void OnLoaded(object sender, RoutedEventArgs args)
        {
            DisplayText("Welcome");
        }

        public void DisplayText(string textToDisplay)
        {
            // Create a formatted text string.
            FormattedText formattedText = new FormattedText(textToDisplay, 
                CultureInfo.GetCultureInfo("en-us"), FlowDirection.LeftToRight,
                new Typeface("Verdana"), 96, Brushes.Black);

            Geometry geometry = formattedText.BuildGeometry(new Point(0, 0));
            PathGeometry pathGeometry = geometry.GetFlattenedPathGeometry();
            path.Data = pathGeometry;

            animation.PathGeometry = pathGeometry;
        }
    }
}
